feat(gomod): run go mod tidy after Go module updates - #8
Conversation
Without postUpdateOptions gomodTidy, Renovate only adds checksums for the new version on each Go module bump and never removes the old ones. In apk-datasource this left ~118 stale go.sum lines across five OpenTelemetry versions before a manual tidy cleaned them up. gomodTidy is scoped to the gomod manager, so repos without a go.mod are unaffected.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe Renovate configuration enables ChangesGo module tidy configuration
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to Renovate will run go mod tidy after Go module dependency updates and documentation now describes that behavior. No concrete current-head merge risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🎉 This PR is included in version 1.3.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Why
Renovate's Go module manager only adds
go.sumchecksums for the new version on each bump and never removes the previous version's entries unlessgomodTidyis enabled. Incwaits6/apk-datasourcethis accumulated about 118 stale lines across OpenTelemetry 1.42 through 1.45 before a manualgo mod tidyin cwaits6/apk-datasource#57 cleaned it up.What
Add
"postUpdateOptions": ["gomodTidy"]so Renovate runsgo mod tidyafter editinggo.mod. Documented in the README table.Blast radius
gomodTidyis scoped to the gomod manager and is never evaluated in a repo withoutgo.mod. Of the repos extending this preset today, onlyapk-datasourceis Go.krypsis-io/wickwill join it via krypsis-io/wick#35.The first Renovate PR in any Go repo after this lands will carry a one-time
go.sumprune. Inapk-datasourcethat already happened in #57, so nothing extra shows up there.Summary by CodeRabbit
New Features
go mod tidyafter Go module updates, helping remove stalego.sumentries.Documentation